MySQL存储过程的创建
DELIMITER //
CREATE PROCEDURE myproc(OUT s int)
BEGIN
SELECT COUNT(*) INTO s FROM students;
END
//
DELIMITER;

批量插入100万条测试数据
mysql> delimiter $$$
mysql> create procedure search()
-> begin
-> declare i int default 0;
-> set i=0;
-> start transaction;
-> while i<1000000 do
-> INSERT INTO `zt_searchindex` ( `objectType`, `objectID`, `title`, `content`, `addedDate`, `editedDate`) VALUES ('task', 35, ' 25968 21488', ' 25968 25454 24211', '2017-11-17 15:44:23', '2017-11-17 15:44:23');
-> set i=i+1;
-> end while;
-> commit;
-> end
-> $$$
mysql> delimiter;
